org.eclipse.vtp.framework.util
Class ConfigurationDictionary

java.lang.Object
  extended by java.util.Dictionary
      extended by org.eclipse.vtp.framework.util.ConfigurationDictionary
All Implemented Interfaces:
java.io.Serializable, java.util.Comparator

public class ConfigurationDictionary
extends java.util.Dictionary
implements java.util.Comparator, java.io.Serializable

Implementation of a ConfigurationAdmin dictionary that can be loaded and saved to and from an XML structure..

Author:
Lonnie Pryor
See Also:
Serialized Form

Constructor Summary
ConfigurationDictionary()
          Creates a new ConfigurationDictionary.
ConfigurationDictionary(org.w3c.dom.Element configuration)
          Creates a new ConfigurationDictionary.
ConfigurationDictionary(java.lang.String pid)
          Creates a new ConfigurationDictionary.
ConfigurationDictionary(java.lang.String pid, java.lang.String factoryPid)
          Creates a new ConfigurationDictionary.
ConfigurationDictionary(java.lang.String pid, java.lang.String factoryPid, java.lang.String bundleLocation)
          Creates a new ConfigurationDictionary.
 
Method Summary
 int compare(java.lang.Object left, java.lang.Object right)
           
 java.util.Enumeration elements()
           
 java.lang.Object get(java.lang.Object key)
           
 java.lang.String getBundleLocation()
          Returns the value of the "service.bundleLocation" property.
 java.lang.String getFactoryPid()
          Returns the value of the "service.factoryPid" property.
 java.lang.String getPid()
          Returns the value of the "service.pid" property.
 boolean isEmpty()
           
 java.util.Enumeration keys()
           
 boolean load(org.w3c.dom.Element configuration)
          Loads the data from the supplied element into this dictionary.
static ConfigurationDictionary[] loadAll(org.w3c.dom.Element configurations)
          Loads all the data from the supplied element into a new array.
 java.lang.Object put(java.lang.Object key, java.lang.Object value)
           
 java.lang.Object remove(java.lang.Object key)
           
 org.w3c.dom.Element save(org.w3c.dom.Document document)
          Converts the contents of this dictionary to an XML structure.
static org.w3c.dom.Element saveAll(org.w3c.dom.Document document, ConfigurationDictionary[] dictionaries)
          Converts the contents of all the supplied dictionaries to an XML structure.
 void setBundleLocation(java.lang.String bundleLocation)
          Sets the value of the "service.bundleLocation" property.
 void setFactoryPid(java.lang.String factoryPid)
          Sets the value of the "service.factoryPid" property.
 void setPid(java.lang.String pid)
          Sets the value of the "service.pid" property.
 int size()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.Comparator
equals
 

Constructor Detail

ConfigurationDictionary

public ConfigurationDictionary()
Creates a new ConfigurationDictionary.


ConfigurationDictionary

public ConfigurationDictionary(java.lang.String pid)
Creates a new ConfigurationDictionary.

Parameters:
pid - The PID of this dictionary.

ConfigurationDictionary

public ConfigurationDictionary(java.lang.String pid,
                               java.lang.String factoryPid)
Creates a new ConfigurationDictionary.

Parameters:
pid - The PID of this dictionary.
factoryPid - The factory PID of this dictionary.

ConfigurationDictionary

public ConfigurationDictionary(java.lang.String pid,
                               java.lang.String factoryPid,
                               java.lang.String bundleLocation)
Creates a new ConfigurationDictionary.

Parameters:
pid - The PID of this dictionary.
factoryPid - The factory PID of this dictionary.
bundleLocation - The bundle location of this dictionary.

ConfigurationDictionary

public ConfigurationDictionary(org.w3c.dom.Element configuration)
                        throws java.lang.NullPointerException
Creates a new ConfigurationDictionary.

Parameters:
configuration - The configuration data for this dictionary's properties.
Throws:
java.lang.NullPointerException - If the supplied configuration is null.
Method Detail

loadAll

public static ConfigurationDictionary[] loadAll(org.w3c.dom.Element configurations)
Loads all the data from the supplied element into a new array.

Parameters:
configurations - The configurations data to load.
Returns:
The configuration dictionaries loaded from the supplied data.

saveAll

public static org.w3c.dom.Element saveAll(org.w3c.dom.Document document,
                                          ConfigurationDictionary[] dictionaries)
Converts the contents of all the supplied dictionaries to an XML structure.

Parameters:
document - The document to use to create the XML structure.
dictionaries - The dictionaries to save.
Returns:
The XML representation of the contents of the supplied dictionaries or null if the supplied document was null.

getPid

public java.lang.String getPid()
Returns the value of the "service.pid" property.

Returns:
The value of the "service.pid" property.

getFactoryPid

public java.lang.String getFactoryPid()
Returns the value of the "service.factoryPid" property.

Returns:
The value of the "service.factoryPid" property.

getBundleLocation

public java.lang.String getBundleLocation()
Returns the value of the "service.bundleLocation" property.

Returns:
The value of the "service.bundleLocation" property.

setPid

public void setPid(java.lang.String pid)
Sets the value of the "service.pid" property.

Parameters:
pid - The value of the "service.pid" property.

setFactoryPid

public void setFactoryPid(java.lang.String factoryPid)
Sets the value of the "service.factoryPid" property.

Parameters:
factoryPid - The value of the "service.factoryPid" property.

setBundleLocation

public void setBundleLocation(java.lang.String bundleLocation)
Sets the value of the "service.bundleLocation" property.

Parameters:
bundleLocation - The value of the "service.bundleLocation" property.

load

public boolean load(org.w3c.dom.Element configuration)
Loads the data from the supplied element into this dictionary.

Parameters:
configuration - The configuration data to load or null to clear this dictionary.
Returns:
True if the data in this dictionary changed.

save

public org.w3c.dom.Element save(org.w3c.dom.Document document)
Converts the contents of this dictionary to an XML structure.

Parameters:
document - The document to use to create the XML structure.
Returns:
The XML representation of the contents of this dictionary or null if the supplied document was null.

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in class java.util.Dictionary

size

public int size()
Specified by:
size in class java.util.Dictionary

keys

public java.util.Enumeration keys()
Specified by:
keys in class java.util.Dictionary

elements

public java.util.Enumeration elements()
Specified by:
elements in class java.util.Dictionary

get

public java.lang.Object get(java.lang.Object key)
Specified by:
get in class java.util.Dictionary

put

public java.lang.Object put(java.lang.Object key,
                            java.lang.Object value)
Specified by:
put in class java.util.Dictionary

remove

public java.lang.Object remove(java.lang.Object key)
Specified by:
remove in class java.util.Dictionary

compare

public int compare(java.lang.Object left,
                   java.lang.Object right)
Specified by:
compare in interface java.util.Comparator